﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using DTC.Database;
using DTC.Converters;

namespace DTC
{
	/// <summary>
	/// Interaction logic for DrugIssuePopup.xaml
	/// </summary>
	public partial class DrugIssuePopup : Window
	{
		public DrugIssuePopup()
		{
			this.InitializeComponent();
            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
		}

        private DTCDrugPrescription drugPrescription;
        public DTCDrugPrescription DrugPrescription
        {
            get
            {
                return drugPrescription;
            }
            set
            {
                if (drugPrescription != value)
                {
                    drugPrescription = value;
                    Title = "Заказы препаратов для пациента " + drugPrescription.DTCPatient.FullName;
                    orders = drugPrescription.DTCPatientOrders.ToList();
                    PatientOrdersListBox.ItemsSource = orders;
                }
            }
        }

	    private List<DTCPatientOrder> orders;

	}
}